<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title><?php echo ($meta_title); ?>|OneThink管理平台</title>
    <link href="/newxgw/Public/favicon.ico" type="image/x-icon" rel="shortcut icon">
    <link rel="stylesheet" type="text/css" href="/newxgw/Public/Admin/css/base.css" media="all">
    <link rel="stylesheet" type="text/css" href="/newxgw/Public/Admin/css/common.css" media="all">
    <link rel="stylesheet" type="text/css" href="/newxgw/Public/Admin/css/module.css">
    <link rel="stylesheet" type="text/css" href="/newxgw/Public/Admin/css/style.css" media="all">
	<link rel="stylesheet" type="text/css" href="/newxgw/Public/Admin/css/<?php echo (C("COLOR_STYLE")); ?>.css" media="all">
    <link rel="stylesheet" type="text/css" href="/newxgw/Public/Admin/css/app.css" >
     <!--[if lt IE 9]>
    <script type="text/javascript" src="/newxgw/Public/static/jquery-1.10.2.min.js"></script>
    <![endif]--><!--[if gte IE 9]><!-->
   <script type="text/javascript" src="/newxgw/Public/static/jquery-2.0.3.min.js"></script>
    <script type="text/javascript" src="/newxgw/Public/Admin/js/jquery.mousewheel.js"></script>
    <script type="text/javascript" src="/newxgw/Public/Admin/js/jquery.validate.min.js"></script>
      <script type="text/javascript" src="/newxgw/Public/Admin/js/messages_zh.js"></script>
      <script type="text/javascript" src="/newxgw/Public/Admin/js/portamento.js"></script>
       <script type="text/javascript" src="/newxgw/Public/Admin/js/layer/layer.js"></script>
    <!--<![endif]-->
    
</head>
<body>
    <!-- 头部 -->
    <div class="header">
        <!-- Logo -->
        <span class="logo"></span>
        <!-- /Logo -->

        <!-- 主导航 -->
        <ul class="main-nav">
            <?php if(is_array($__MENU__["main"])): $i = 0; $__LIST__ = $__MENU__["main"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$menu): $mod = ($i % 2 );++$i;?><li class="<?php echo ((isset($menu["class"]) && ($menu["class"] !== ""))?($menu["class"]):''); ?>"><a href="<?php echo (u($menu["url"])); ?>"><?php echo ($menu["title"]); ?></a></li><?php endforeach; endif; else: echo "" ;endif; ?>
        </ul>
        <!-- /主导航 -->

        <!-- 用户栏 -->
        <div class="user-bar">
            <a href="javascript:;" class="user-entrance"><i class="icon-user"></i></a>
            <ul class="nav-list user-menu hidden">
                <li class="manager">你好，<em title="<?php echo session('user_auth.username');?>"><?php echo session('user_auth.username');?></em></li>
                <li><a href="<?php echo U('User/updatePassword');?>">修改密码</a></li>
                <li><a href="<?php echo U('User/updateNickname');?>">修改昵称</a></li>
                <li><a href="<?php echo U('Public/logout');?>">退出</a></li>
            </ul>
        </div>
    </div>
    <!-- /头部 -->

    <!-- 边栏 -->
    <div class="sidebar">
        <!-- 子导航 -->
        
    <div id="subnav" class="subnav">

 
    <?php if(!empty($_extra_menu)): ?>
        <?php echo extra_menu($_extra_menu,$__MENU__); endif; ?>
    <?php if(is_array($__MENU__["child"])): $i = 0; $__LIST__ = $__MENU__["child"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$sub_menu): $mod = ($i % 2 );++$i;?><!-- 子导航 -->
     
        <?php if(!empty($sub_menu)): if(!empty($key)): ?><h3><i class="icon icon-unfold"></i><?php echo ($key); ?></h3><?php endif; ?>
            <ul class="side-sub-menu">
                <?php if(is_array($sub_menu)): $i = 0; $__LIST__ = $sub_menu;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$menu): $mod = ($i % 2 );++$i;?><li>
                        <a class="item" href="<?php echo (u($menu["url"])); ?>"><?php echo ($menu["title"]); ?></a>
                    </li><?php endforeach; endif; else: echo "" ;endif; ?>
            </ul><?php endif; ?>
        <!-- /子导航 --><?php endforeach; endif; else: echo "" ;endif; ?>
 


</div>
<script>
    $(function(){
        $(".side-sub-menu li").hover(function(){
            $(this).addClass("hover");
        },function(){
            $(this).removeClass("hover");
        });
    })
</script>


        <!-- /子导航 -->
    </div>
    <!-- /边栏 -->

    <!-- 内容区 -->
    <div id="main-content">
        <div id="top-alert" class="fixed alert alert-error" style="display: none;">
            <button class="close fixed" style="margin-top: 4px;">&times;</button>
            <div class="alert-content">这是内容</div>
        </div>
        <div id="main" class="main">
            
            <!-- nav -->
            <?php if(!empty($_show_nav)): ?><div class="breadcrumb">
                <span>您的位置:</span>
                <?php $i = '1'; ?>
                <?php if(is_array($_nav)): foreach($_nav as $k=>$v): if($i == count($_nav)): ?><span><?php echo ($v); ?></span>
                    <?php else: ?>
                    <span><a href="<?php echo ($k); ?>"><?php echo ($v); ?></a>&gt;</span><?php endif; ?>
                    <?php $i = $i+1; endforeach; endif; ?>
            </div><?php endif; ?>
            <!-- nav -->
            

            
	<script type="text/javascript" src="/newxgw/Public/static/uploadify/jquery.uploadify.min.js"></script>
<!-- <div id="main-content" style="">
<div class="main" id="main" style="">  -->
  
  <!-- nav --> 
  
  <!-- nav --> 
  
  <!-- 数据列表 -->
  
  <div class="data-table" style="">
    <div class="data-table table-striped" style="">
      <div class="picmsg" style="">
        <div class="yz_left">
          <div id="portamento_container" style="min-height: 145px; width: 311px;"><div id="sidebar" style="top: 0px;">
            
          </div>
        </div>
          
          
          
          <div  class="tjgg">
          

<div class="form_itme">
           <div>
              <strong class="title yz_left">规格名称: </strong>
          <input type="text" value="" id="rulename" name="phone" >
          </div><div>
          <strong class="title yz_left">规格价格: </strong>
          <input type="text" value="" id="ruleprice" name="phone" >
          </div>
          <div>
          <strong class="title yz_left">剩余库存: </strong>
          <input type="text" value="" id="goodstock" name="phone" >
          <button class='bcs'>添加规格</button>
          <button class='ttjson'>表格转json</button>
          </div>         
            </div>
              

<div id="ruletable">
  <table id="ruletable" border="1" cellpadding="5" cellspacing=0>
				<tbody>
					<tr>
						<th>规格名称</th>
						<th>规格价格</th>
						<th>剩余库存</th>
						<th>&nbsp;</th>
					</tr>
					
					 <?php if(is_array($rulelist)): $i = 0; $__LIST__ = $rulelist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$ruledata): $mod = ($i % 2 );++$i;?><tr>
											<td><?php echo ($ruledata["rule_name"]); ?></td>
											<td><?php echo ($ruledata["rule_price"]); ?></td>
											<td><?php echo ($ruledata["stock"]); ?></td>
<!--
											<td><a class="ruledel" href="<?php echo U(goodsruledel);?>">鍒犻櫎</a></td>
-->
											<td><a class="ruledel">删除</a></td>
											<input type="hidden" name="ruleid" value="<?php echo ($ruledata["id"]); ?>" id="ruleid<?php echo ($ruledata["id"]); ?>"/>
						</tr><?php endforeach; endif; else: echo "" ;endif; ?>
					<!--
					<tr>
											<td>Tom</td>
											<td>tom@tom.com</td>
											<td>5000</td>
											<td><a href="deleteEmp?id=Tom">鍒犻櫎瑙勬牸</a></td>
										</tr>
										<tr>
											<td>Jerry</td>
											<td>jerry@sohu.com</td>
											<td>8000</td>
											<td><a href="deleteEmp?id=Jerry">鍒犻櫎瑙勬牸</a></td>
										</tr>-->
					
				</tbody>
			</table>
</div>

</div>
        </div>
        
        
        
        <div class="yz_right width540 fromblock" style="">
        	<!--
			<?php
 var_dump($shoplist); ?>-->
			
          <form   enctype="multipart/form-data" action="<?php echo U('insertone');?>" class="form-horizontal" method="post" style="">
            <div class="form_itme">
              <label class="form_label yz_clear">
              <strong class="title yz_left">所属类别</strong>
              <p class="tips yz_left">（必填）</p>
              </label>
              <span style="display:block" class="counter_in yz_clear">
              <select id="cat_id" name="cat_id">
              	 <?php if(is_array($catlist)): $i = 0; $__LIST__ = $catlist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$cat): $mod = ($i % 2 );++$i;?><option value="<?php echo ($cat['id']); ?>"> 
                     <?php echo ($cat['cat_name']); ?>
                  </option><?php endforeach; endif; else: echo "" ;endif; ?>
                </select>
              </span> </div>
              
              
              
              <div class="form_itme">
              <label class="form_label yz_clear">
              <strong class="title yz_left">所属商家</strong>
              <p class="tips yz_left">（必填）</p>
              </label>
              <span style="display:block" class="counter_in yz_clear">
              <select id="shop_id" name="shop_id">
              	
              	<?php if(is_array($shoplist)): $i = 0; $__LIST__ = $shoplist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$shoplist): $mod = ($i % 2 );++$i;?><option value="<?php echo ($shoplist['id']); ?>"> 
                     <?php echo ($shoplist['shopname']); ?>
                  </option><?php endforeach; endif; else: echo "" ;endif; ?>
                                     </select>
              </span> </div>
              
              <div id="parentIframe">aavbbdd</div>
              <?php  var_dump($rulelist); ?>
            <div class="form_itme">
              <label class="form_label">
              <strong class="title yz_left">标题</strong>
              <p class="tips yz_left">（必填）</p>
              </label>
              <span class="form_input_box counter_in yz_clear">
              <input type="text" value="<?php echo ((isset($info["good_name"]) && ($info["good_name"] !== ""))?($info["good_name"]):''); ?>" name="good_name" id="good_name" class="form_input limited">
              <em class="form_input_append frm_counter">64/64</em> </span> </div>
            <div class="form_itme">
              <label class="form_label">
              <strong class="title yz_left">产品特点</strong>
              <p class="tips yz_left">（设置产品特点之后前台页面可以开始产品特点功能）</p>
              </label>
           <!--    <div class=" counter_in yz_clear"> 
              <div class="icheckbox_minimal checked" style="position: relative;">
              <input type="checkbox" checked="" value="" name="istop" style="position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"><ins class="iCheck-helper" style="position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;">
              </ins></div> 热门 <div class="icheckbox_minimal checked" style="position: relative;"><input type="checkbox" checked="" value="" name="isrecommend" style="position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"><ins class="iCheck-helper" style="position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div> 推荐 <div class="icheckbox_minimal checked" style="position: relative;"><input type="checkbox" checked="" value="" name="isspecial" style="position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"><ins class="iCheck-helper" style="position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div> 特别推荐 
              </div> -->
              <div class=" counter_in yz_clear"> <input type="checkbox" name="istop" value="<?php echo ($vo["istop"]); ?>" 
                <?php if(($vo["istop"]) == ""): ?>checked<?php endif; ?>
                > 热门 <input type="checkbox" name="isrecommend" value="<?php echo ($vo["isrecommend"]); ?>" 
                <?php if(($vo["isrecommend"]) == ""): ?>checked<?php endif; ?>
                > 推荐 <input type="checkbox" name="isspecial" value="<?php echo ($vo["isspecial"]); ?>" 
                <?php if(($vo["isspecial"]) == ""): ?>checked<?php endif; ?>
                > 特别推荐 </div>
            </div>
            <div class="form_itme">
              <label class="form_label">
              <strong class="title yz_left">产品标签</strong>
              <p class="tips yz_left">（设置产品标签之后前台页面可以开始产品标签功能）</p>
              </label>
              <!-- <div class=" counter_in yz_clear"> <div class="iradio_minimal" style="position: relative;"><input type="radio" value="0" name="label" style="position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"><ins class="iCheck-helper" style="position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div> 不使用 <div class="iradio_minimal" style="position: relative;"><input type="radio" value="1" name="label" style="position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"><ins class="iCheck-helper" style="position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>
                
                今日特价 <div class="iradio_minimal" style="position: relative;"><input type="radio" value="2" name="label" style="position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"><ins class="iCheck-helper" style="position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>热销商品<div class="iradio_minimal" style="position: relative;"><input type="radio" value="3" name="label" style="position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"><ins class="iCheck-helper" style="position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>新品上架 
                </div> -->
                <div class=" counter_in yz_clear"> <input type="radio" name="label" value="0" 
                <?php if(($vo["label"]) == "0"): ?>checked<?php endif; ?>
                > 不使用 <input type="radio" name="label" value="1" 
                <?php if(($vo["label"]) == "1"): ?>checked<?php endif; ?>
                >
                
                今日特价 <input type="radio" name="label" value="2" 
                <?php if(($vo["label"]) == "2"): ?>checked<?php endif; ?>
                >热销商品<input type="radio" name="label" value="3" 
                <?php if(($vo["label"]) == "3"): ?>checked<?php endif; ?>
                >新品上架 </div>
            </div>
            <div class="form_itme">
              <label class="form_label">
              <strong class="title yz_left">特色描述</strong>
              <p class="tips yz_left">（选填）</p>
              </label>
              <span class="form_input_box counter_in yz_clear">
              <input type="text" value="" name="good_remark" id="good_remark" class="form_input limited">
              <em class="form_input_append frm_counter">32/32</em> </span> </div>
              
               <div class="form_itme">
              <label class="form_label">
              <strong class="title yz_left">是否可邮</strong>
              <p class="tips yz_left">（选填）</p>
              </label>
              <span class="form_input_box counter_in yz_clear">
              <input type="text" value="" name="shorttitle" id="shorttitle" class="form_input limited">
              <em class="form_input_append frm_counter">32/32</em> </span> </div>
           <!--  <div class="form_itme">
              <label class="form_label">
              <strong class="title yz_left">商家咨询电话</strong>
              <p class="tips yz_left">（填写咨询电话，前台可以通过打电话联系商家）</p>
              </label>
              <span class="form_input_box counter_in yz_clear">
              <input type="text" value="" id="phone" name="phone" class="form_input limited">
              <em class="form_input_append frm_counter">11/11</em> </span> </div>
              <div class="form_itme">

              <label class="form_label">

              <strong class="title yz_left">商家联系邮箱</strong>

              <p class="tips yz_left">（填写联系邮箱，订单会以邮件形式发送）</p>

              </label>

              <span class="form_input_box counter_in yz_clear">

              <input type="text" value="" id="email" name="email" class="form_input limited">

              <em class="form_input_append frm_counter">11/11</em> </span> </div> -->
           <!--  <div class="form_itme">
              <label class="form_label">
              <strong class="title yz_left">商品单位</strong>
              <p class="tips yz_left">（必填，例如0.5斤表示0.5斤对应的价格）</p>
              </label>
              <span class="form_input_box counter_in yz_clear">
              <input type="text" value="" id="unity" name="unity" class="form_input limited">
              <em class="form_input_append frm_counter">8/8</em> </span> </div>
            <div class="form_itme">
              <label class="form_label">
              <strong class="title yz_left">采购价格</strong>
              <p class="tips yz_left">（必填）</p>
              </label>
              <span class="form_input_box counter_in yz_clear">
              <input type="text" value="" id="price0" name="price0" class="form_input limited">
              <em class="form_input_append frm_counter">8/8</em> </span> </div>
            <div class="form_itme">
              <label class="form_label">
              <strong class="title yz_left">本店价格</strong>
              <p class="tips yz_left">（必填）</p>
              </label>
              <span class="form_input_box counter_in yz_clear">
              <input type="text" value="" id="price" name="price" class="form_input limited">
              <em class="form_input_append frm_counter">8/8</em> </span> </div>
            <div class="form_itme">
              <label class="form_label">
              <strong class="title yz_left">市场价格</strong>
              <p class="tips yz_left">（选填）</p>
              </label>
              <span class="form_input_box counter_in yz_clear">
              <input type="text" value="" id="price1" name="price1" class="form_input limited">
              <em class="form_input_append frm_counter">8/8</em> </span> </div>
            <div class="form_itme">
              <label class="form_label">
              <strong class="title yz_left">产地</strong>
              <p class="tips yz_left">（选填）</p>
              </label>
              <span class="form_input_box counter_in yz_clear">
              <input type="text" value="" id="producer" name="producer" class="form_input limited">
              <em class="form_input_append frm_counter">24/24</em> </span> </div>
            <div class="form_itme">
              <label class="form_label">
              <strong class="title yz_left">相关产品</strong>
              <p class="tips yz_left">（<a onclick="selectRelate('relation_text','')" class="" href="javascript:void()">选择</a>）</p>
              </label>
              <ul style="width:100%; clear:both" id="relation_text" class="list-dot">
                              </ul>
            </div> -->
            <div class="form_itme islows               hide              ">
              <label class="form_label">
              <strong class="title yz_left">开始时间</strong>
              <p class="tips yz_left">（必填）</p>
              </label>
              <span class="form_input_box counter_in yz_clear">
              <input type="text" value="" name="starttime" id="starttime" class="form_input limited">
              </span> </div>
            <div class="form_itme islows                hide              ">
              <label class="form_label">
              <strong class="title yz_left">结束时间</strong>
              <p class="tips yz_left">（必填）</p>
              </label>
              <span class="form_input_box counter_in yz_clear">
              <input type="text" value="" name="endtime" id="endtime" class="form_input limited">
              </span> </div>
           
              
              
              
              <div class="controls">
									封面：
									<input type="file" id="upload_picture_test">
									<input type="hidden" name="cover_id" id="cover_id_name"/>
									
									
									<div class="yz_grid"> <strong id="showtitle"></strong>
              <div class="panel-footer clearfix"><span class="pull-right gray"></span> </div>
              <div class="imgholder">
              	<a id="backpic" class="bigpic" target="_blank" href="javascript:void()"></a>
                 </div>
              <div id="showinfo" class="info"></div>
            </div>
            
								</div>
								<script type="text/javascript">
								//上传图片
							    /* 初始化上传插件 */
								$("#upload_picture_test").uploadify({
							        "height"          : 30,
							        "swf"             : "/newxgw/Public/static/uploadify/uploadify.swf",
							        "fileObjName"     : "download",
							        "buttonText"      : "上传图片",
							        "uploader"        : "<?php echo U('File/uploadPicture',array('session_id'=>session_id()));?>",
							        "width"           : 120,
							        'removeTimeout'	  : 1,
							        'fileTypeExts'	  : '*.jpg; *.png; *.gif;',
							        "onUploadSuccess" : uploadPicturetest,
							        'onFallback' : function() {
							            alert('未检测到兼容版本的Flash.');
							        }
							    });
								function uploadPicturetest(file, data){
							    	var data = $.parseJSON(data);
							    	var src = '';
							        if(data.status){
							        	src = data.url || '/newxgw' + data.path
							        	$("#backpic").html('<img src="' + src + '" />')
							        	$("#cover_id_name").val(data.id);
							        	//alert("aaaa");<img src="./Uploads/Picture/2015-08-08/55c609ff73a8b.jpg" />
							        	/*
										$("#cover_id_<?php echo ($field["name"]); ?>").val(data.id);
																				src = data.url || '/newxgw' + data.path
																				$("#cover_id_<?php echo ($field["name"]); ?>").parent().find('.upload-img-box').html(
																					'<div class="upload-pre-item"><img src="' + src + '"/></div>'
																				);*/
										
							        } else {
							        	updateAlert(data.info);
							        	setTimeout(function(){
							                $('#top-alert').find('button').click();
							                $(that).removeClass('disabled').prop('disabled',false);
							            },1500);
							        }
							    }
								</script>
              
            <div class="form_itme yz_clear">
              <label class="form_label">
              <strong class="title yz_left">介绍</strong>
              <p class="tips yz_left">（选填）</p>
              </label>
              <span class="form_textarea_box yz_clear">
<!--
              <textarea name="description" max-length="120" id="description" class="form_textarea js_desc js_counter"></textarea>
-->
               <input type="text" name="good_brief" value="" id="good_brief"/>
              <em class="form_input_append frm_counter">120/120</em> </span> </div>
            <div class="form_itme yz_clear" id="pic" style="">
              <label class="form_label yz_clear">
              <strong class="title yz_left">详细说明</strong>
              <p class="tips yz_left">（自动保存：2015-04-10 22:59:39）</p>
              </label>
                               <label class="textarea">
                                <textarea name="good_desc" id="good_desc"></textarea>
                                <?php echo hook('adminArticleEdit');?>
                                </label>
              </div>
            
            <input type="hidden" id="islowed" value="" name="islow">
            <input type="hidden" id="ruleall" value="" name="ruleall">
            <input type="hidden" value="" name="id">
            <div class="yz_form_action">
              <button  id="testsub"  type="submit" target-form="form-horizontal" class="yz_btn submit-btn ajax-post no-refresh">确 定</button>
              <button onclick="javascript:history.back(-1);return false;" class="btn btn_default">返 回</button>
            </div>
          </form>
        </div>
        <div class="yz_clear"></div>
      </div>
      <div class="yz_clear"></div>
    </div>
    <div class="yz_clear"></div>
  </div>
  <div class="yz_clear"></div>
</div>
<div class="yz_clear"></div>
<link href="/shop/Public/artDialog/css/ui-dialog.css" rel="stylesheet">
<script src="/shop/Public/artDialog/js/dialog.js"></script> 
<script src="/shop/Public/artDialog/js/dialog-plus.js"></script> 



<script type="text/javascript">
function checktable(){
			
			//var34="333";			    
			// return var34;
			 var len=$('#ruletable tr').length;
 
//var aaa=$("ruletable tr td").eq(1).text();
//var aaa=$("#ruletable tr:eq(1) td:eq(1)").text();
var zj="";
if(len>1){
	zj="[";
	for (var i=1; i < len; i++) {
	  var aaa=$("#ruletable tr").eq(i).find("td").eq(0).text();
	  var bbb=$("#ruletable tr").eq(i).find("td").eq(1).text();
	  var ccc=$("#ruletable tr").eq(i).find("td").eq(2).text();
	  //zj=zj+"\{"+"rulename:'"+aaa+"',ruleprice:'"+bbb+"',rulestoce:'"+ccc+"'},";
	 zj=zj+'{"rulename":"'+aaa+'","ruleprice":"'+bbb+'","rulestock":"'+ccc+'"},';
	  
	};
	zj=zj.substring(0,zj.length-1)+"]";
			 
			 }
			 return zj;
				}			    

$(function(){
	$(".ruledel").click(function() {
		
		layer.open({
        type: 2,
        title: '修改规格',
        maxmin: true,
        shadeClose: true, //点击遮罩关闭层
        area : ['400px' , '260px'],
        content: ["<?php echo U('ruleedit',array('rule_id'=>9));?>",'no']
   
               })
               
		/*
		var b=window.confirm("浣犵‘瀹氳鍒犻櫎锛�"+$(this).parent().parent().children().eq(0).text());
							
							if(b){
								//alert("varaaid==");
								var rule_id=$(this).parent().parent().find('input').val();
								//alert(varaa);
								var rule_url=$(this).attr('href');
								alert(rule_url);
								var send_data={"rule_id":rule_id};
					var xmlHttpRequest=$.post(rule_url,send_data,function(data,ts){
					
						window.location.reload();
						// //$(this).parent().parent().remove();
						// var rule_url2=$(this).attr('href');
						// alert(rule_url2);
						// var aa=$(this).parent().parent().text();
						// alert(aa);
						//
						
					})
		
					
				//	$(this).parent().parent().remove();
								return false;
							}else{
								return false;
							}*/
		
		});

	
$("#testsub").click(function() {
	var abc=checktable();
	if(abc){
		$("#ruleall").attr("value",abc);

		
	}else{
		alert("请增加规格");
		return false;
	}
	
		return true;
});

	$('#sidebar').portamento({

     wrapper: $('.picmsg')  // set #wrapper as the bottom boundary

      });
      
      $(".ttjson").click(function() {
         
 var data = " [ {name:'6101',value:'北京市',age:'11'}, {name:'6102',value:'天津市',age:'11'}, {name:'6103',value:'上海市',age:'22'}]"; 
 //$('#ruletable tr').append($tr);
 var len=$('#ruletable tr').length;
 
//var aaa=$("ruletable tr td").eq(1).text();
//var aaa=$("#ruletable tr:eq(1) td:eq(1)").text();
if(len<2){
	alert("tjgg"); 
}else{
	
	
	var zj="[";
	for (var i=1; i < len; i++) {
	  var aaa=$("#ruletable tr").eq(i).find("td").eq(0).text();
	  var bbb=$("#ruletable tr").eq(i).find("td").eq(1).text();
	  var ccc=$("#ruletable tr").eq(i).find("td").eq(2).text();
	  zj=zj+"\ {"+"rulename:'"+aaa+"',ruleprice:'"+bbb+"',rulestoce:'"+ccc+"'},";
	 
	  
	};
	zj=zj.substring(0,zj.length-1)+"]"
	alert(zj);
	
}




         });

$(".bcs").click(function(){
	
	// $(".tjgg").append($(".gg:first").clone(true));
              	var in_rulename=$('#rulename').val();
				var in_ruleprice=$('#ruleprice').val();
				var in_goodstock=$('#goodstock').val();
				
				$tr=$("<tr></tr>");
				
				$name_td=$("<td></td>");
				$name_td.text(in_rulename);//"<td>名字</td>"
				$email_td=$("<td></td>");
				$email_td.text(in_ruleprice);//"<td>电邮</td>"
				$tel_td=$("<td></td>");
				$tel_td.text(in_goodstock);//"<td>电话</td>"
				
				$a_td=$("<td></td>");
				$myHref=$("<a></a>");
				$myHref.text("删除");
				$myHref.attr("href","#");
				$a_td.append($myHref);
				
				$tr.append($name_td);
				$tr.append($email_td);
				$tr.append($tel_td);
				$tr.append($a_td);
				
				$myHref.click(function(){
					//如何显示用户名字，并且让用户选择是否真的删除用户
					//<a href='delEmpController.php?name=顺平'>删除</a>
					var b=window.confirm("你确定要删除？"+$(this).parent().parent().children().eq(0).text());
					
					if(b){
						$(this).parent().parent().remove();
						return false;
					}else{
						return false;
					}
				
				})
				
				$('#ruletable tbody').append($tr);
				
	});


	$("body").on('click',".picboxs_action a.delbtn",function(){
		$(this).parents(".piclist").remove();
	})

})

</script> 
<script src="/shop/Public/js/portamento.js"></script> 


</div>

        </div>
        <div class="cont-ft">
            <div class="copyright">
                <div class="fl">感谢使用<a href="http://www.onethink.cn" target="_blank">OneThink</a>管理平台</div>
                <div class="fr">V<?php echo (ONETHINK_VERSION); ?></div>
            </div>
        </div>
    </div>
    <!-- /内容区 -->
    <script type="text/javascript">
    (function(){
        var ThinkPHP = window.Think = {
            "ROOT"   : "/newxgw", //当前网站地址
            "APP"    : "/newxgw/index.php?s=", //当前项目地址
            "PUBLIC" : "/newxgw/Public", //项目公共目录地址
            "DEEP"   : "<?php echo C('URL_PATHINFO_DEPR');?>", //PATHINFO分割符
            "MODEL"  : ["<?php echo C('URL_MODEL');?>", "<?php echo C('URL_CASE_INSENSITIVE');?>", "<?php echo C('URL_HTML_SUFFIX');?>"],
            "VAR"    : ["<?php echo C('VAR_MODULE');?>", "<?php echo C('VAR_CONTROLLER');?>", "<?php echo C('VAR_ACTION');?>"]
        }
    })();
    </script>
    <script type="text/javascript" src="/newxgw/Public/static/think.js"></script>
    <script type="text/javascript" src="/newxgw/Public/Admin/js/common.js"></script>
    <script type="text/javascript">
        +function(){
            var $window = $(window), $subnav = $("#subnav"), url;
            $window.resize(function(){
                $("#main").css("min-height", $window.height() - 130);
            }).resize();

            /* 左边菜单高亮 */
            url = window.location.pathname + window.location.search;
            url = url.replace(/(\/(p)\/\d+)|(&p=\d+)|(\/(id)\/\d+)|(&id=\d+)|(\/(group)\/\d+)|(&group=\d+)/, "");
            $subnav.find("a[href='" + url + "']").parent().addClass("current");

            /* 左边菜单显示收起 */
            $("#subnav").on("click", "h3", function(){
                var $this = $(this);
                $this.find(".icon").toggleClass("icon-fold");
                $this.next().slideToggle("fast").siblings(".side-sub-menu:visible").
                      prev("h3").find("i").addClass("icon-fold").end().end().hide();
            });

            $("#subnav h3 a").click(function(e){e.stopPropagation()});

            /* 头部管理员菜单 */
            $(".user-bar").mouseenter(function(){
                var userMenu = $(this).children(".user-menu ");
                userMenu.removeClass("hidden");
                clearTimeout(userMenu.data("timeout"));
            }).mouseleave(function(){
                var userMenu = $(this).children(".user-menu");
                userMenu.data("timeout") && clearTimeout(userMenu.data("timeout"));
                userMenu.data("timeout", setTimeout(function(){userMenu.addClass("hidden")}, 100));
            });

	        /* 表单获取焦点变色 */
	        $("form").on("focus", "input", function(){
		        $(this).addClass('focus');
	        }).on("blur","input",function(){
				        $(this).removeClass('focus');
			        });
		    $("form").on("focus", "textarea", function(){
			    $(this).closest('label').addClass('focus');
		    }).on("blur","textarea",function(){
			    $(this).closest('label').removeClass('focus');
		    });

            // 导航栏超出窗口高度后的模拟滚动条
            var sHeight = $(".sidebar").height();
            var subHeight  = $(".subnav").height();
            var diff = subHeight - sHeight; //250
            var sub = $(".subnav");
            if(diff > 0){
                $(window).mousewheel(function(event, delta){
                    if(delta>0){
                        if(parseInt(sub.css('marginTop'))>-10){
                            sub.css('marginTop','0px');
                        }else{
                            sub.css('marginTop','+='+10);
                        }
                    }else{
                        if(parseInt(sub.css('marginTop'))<'-'+(diff-10)){
                            sub.css('marginTop','-'+(diff-10));
                        }else{
                            sub.css('marginTop','-='+10);
                        }
                    }
                });
            }
        }();
    </script>
    
</body>
</html>